import { FC } from 'react'
import { Table, PaginationProps, Pagination } from 'antd'
import React from 'react'

interface DataType {
  key: React.Key
  membernumber:number,
  name: string
  discount: number
  sort: string
  point: number
  profilenumber: number
  price: number
  balance: number
  tel: number
  status: string
  rework: string
  delete: string
}

const showTotal: PaginationProps['showTotal'] = total => `共有 ${total} 条记录`

const columns = [
  {
    title: '序号',
    dataIndex: 'key',
    key: 'key',
  },
  {
    title: '会员号',
    dataIndex: 'membernumber',
    key: 'key',
  
  },
  {
    title: '姓名',
    dataIndex: 'name',
    key: 'key',
  },
  {
    title: '会员类型',
    dataIndex: 'sort',
    key: 'key',
  },
  {
    title: '折扣',
    dataIndex: 'discount',
    key: 'key',
  },
  {
    title: '消费次数',
    dataIndex: 'profilenumber',
    key: 'key',
  },
  {
    title: '可用积分',
    dataIndex: 'point',
    key: 'key',
  },
  {
    title: '消费金额',
    dataIndex: 'price',
    key: 'key',
  },
  {
    title: '储值余额',
    dataIndex: 'balance',
    key: 'key',
  },
  {
    title: '手机号码',
    dataIndex: 'tel',
    key: 'key',
  },
  {
    title: '状态',
    dataIndex: 'status',
    key: 'key',
  },
  {
    title: '操作',
    dataIndex: 'rework',
    key: 'key',
  },
  {
    title: '删除',
    dataIndex: 'delete',
    key: 'key',
  },
]

const data: DataType[] = [
  {
    key: '1',
    membernumber: 620001,
    name: '十月大神',
    sort: '钻石卡',
    discount: 8.5,
    profilenumber: 128,
    point: 3222,
    price: 3222,
    balance: 1000,
    tel: 18812345678,
    status: '正常',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '2',
    membernumber: 620002,
    name: '十月大神',
    sort: '钻石卡',
    discount: 8.5,
    profilenumber: 122,
    point: 2223,
    price: 2223,
    balance: 1000,
    tel: 18812345678,
    status: '正常',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '3',
    membernumber: 620003,
    name: '十月大神',
    sort: '钻石卡',
    discount: 8.8,
    profilenumber: 167,
    point: 789,
    price: 789,
    balance: 500,
    tel: 18812345678,
    status: '正常',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '4',
    membernumber: 620004,
    name: '十月大神',
    sort: '钻石卡',
    discount: 8.8,
    profilenumber: 47,
    point: 467,
    price: 467,
    balance: 1000,
    tel: 18812345678,
    status: '正常',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '5',
    membernumber: 620005,
    name: '十月大神',
    sort: '钻石卡',
    discount: 8.5,
    profilenumber: 128,
    point: 467,
    price: 467,
    balance: 500,
    tel: 18812345678,
    status: '正常',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '6',
    membernumber: 620005,
    name: '十月大神',
    sort: '钻石卡',
    discount: 8.5,
    profilenumber: 128,
    point: 3222,
    price: 3222,
    balance: 1000,
    tel: 18812345678,
    status: '正常',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '7',
    membernumber: 620006,
    name: '十月大神',
    sort: '银卡',
    discount: 9.0,
    profilenumber: 24,
    point: 124,
    price: 124,
    balance: 200,
    tel: 18812345678,
    status: '正常',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '8',
    membernumber: 620007,
    name: '十月大神',
    sort: '铜卡',
    discount: 9.5,
    profilenumber: 3,
    point: 122,
    price: 122,
    balance: 0,
    tel: 18812345678,
    status: '正常',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '9',
    membernumber: 620008,
    name: '十月大神',
    sort: '铜卡',
    discount: 9.5,
    profilenumber: 1,
    point: 12,
    price: 12,
    balance: 0,
    tel: 18812345678,
    status: '正常',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '10',
    membernumber: 620009,
    name: '十月大神',
    sort: '铁卡',
    discount: 9.8,
    profilenumber: 1,
    point: 12,
    price: 12,
    balance: 0,
    tel: 18812345678,
    status: '挂失',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '11',
    membernumber: 620010,
    name: '十月大神',
    sort: '铁卡',
    discount: 9.8,
    profilenumber: 1,
    point: 11,
    price: 11,
    balance: 0,
    tel: 18812345678,
    status: '禁用',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '12',
    membernumber: 620011,
    name: '十月大神',
    sort: '银卡',
    discount: 8.6,
    profilenumber: 100,
    point: 100,
    price: 100,
    balance: 800,
    tel: 18812345678,
    status: '挂失',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '13',
    membernumber: 620012,
    name: '十月大神',
    sort: '金卡',
    discount: 8.5,
    profilenumber: 128,
    point: 1500,
    price: 1500,
    balance: 1000,
    tel: 18812345678,
    status: '挂失',
    rework: '修改',
    delete: '删除 '
  },
  {
    key: '14',
    membernumber: 620013,
    name: '十月大神',
    sort: '金卡',
    discount: 8.5,
    profilenumber: 128,
    point: 3222,
    price: 3222,
    balance: 1000,
    tel: 18812345678,
    status: '挂失',
    rework: '修改',
    delete: '删除 '
  },
]
const AppProfileData: FC = () => {
  return (
    <div className='styled-profile-data'>
      <Table columns={columns} dataSource={data} pagination={false} sortDirections={['ascend']} tableLayout={'auto'} />
      <Pagination 
      size="small"
      total={13}
      showTotal={showTotal}
      showSizeChanger
      showQuickJumper
      />
    </div>
  )
}

 
export default AppProfileData

